package com.woniuxy.config.pgsql;

import org.springframework.boot.context.properties.ConfigurationProperties;
import org.springframework.stereotype.Component;
/**
 * @Author: 马宇航
 * @Description: pgsql的驱动 host连接
 * @DateTime: 25/10/31/星期五 14:45
 * @Component: 成都蜗牛学苑
 **/
@Component
@ConfigurationProperties(prefix = "spring.woniudatasouce")
public class CumsumerPgProperties {
        private String url;
        private String driverClassName;
        private String username;
        private String password;
        // Hikari连接池参数（嵌套配置）
        private Hikari hikari = new Hikari();

        // Getter和Setter
        public String getUrl() { return url; }
        public void setUrl(String url) { this.url = url; }

        public String getDriverClassName() { return driverClassName; }
        public void setDriverClassName(String driverClassName) { this.driverClassName = driverClassName; }

        public String getUsername() { return username; }
        public void setUsername(String username) { this.username = username; }

        public String getPassword() { return password; }
        public void setPassword(String password) { this.password = password; }

        public Hikari getHikari() { return hikari; }
        public void setHikari(Hikari hikari) { this.hikari = hikari; }

        // 嵌套类：Hikari连接池参数 spring.woniudatasouce.Hikari.maximumPoolSize
    public static class Hikari {
        private int maximumPoolSize;
        private int connectionTimeout;

        // Getter和Setter
        public int getMaximumPoolSize() { return maximumPoolSize; }
        public void setMaximumPoolSize(int maximumPoolSize) { this.maximumPoolSize = maximumPoolSize; }

        public int getConnectionTimeout() { return connectionTimeout; }
        public void setConnectionTimeout(int connectionTimeout) { this.connectionTimeout = connectionTimeout; }
    }
}

